/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.hpvas.gui.internalframe;

/**
 *
 * @author sony
 */
public class OwnerInternalFrame extends javax.swing.JInternalFrame {

    public OwnerAddFrame ownerAdd = new OwnerAddFrame();
    public OwnerDeleteOwner ownerDelete = new OwnerDeleteOwner();
    public OwnerUpdateFrame ownerUpdateFrame = new OwnerUpdateFrame();
    public OwnerReadFrame ownerReadFrame = new OwnerReadFrame();
    /**
     * Creates new form OwnerInternalFrame
     */
    public OwnerInternalFrame() {
        initComponents();
         int ancho=900;
         int alto=550;
         setSize(ancho, alto);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar3 = new javax.swing.JToolBar();
        addButtonJB = new javax.swing.JButton();
        updateButtonJB = new javax.swing.JButton();
        deleteButtonJB = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        ownerPanel = new javax.swing.JPanel();

        jToolBar3.setRollover(true);

        addButtonJB.setForeground(new java.awt.Color(0, 0, 153));
        addButtonJB.setText("Add ");
        addButtonJB.setFocusable(false);
        addButtonJB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        addButtonJB.setPreferredSize(new java.awt.Dimension(80, 25));
        addButtonJB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        addButtonJB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addButtonJBActionPerformed(evt);
            }
        });
        jToolBar3.add(addButtonJB);

        updateButtonJB.setForeground(new java.awt.Color(0, 0, 153));
        updateButtonJB.setText("Update");
        updateButtonJB.setFocusable(false);
        updateButtonJB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        updateButtonJB.setPreferredSize(new java.awt.Dimension(80, 25));
        updateButtonJB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        updateButtonJB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateButtonJBActionPerformed(evt);
            }
        });
        jToolBar3.add(updateButtonJB);

        deleteButtonJB.setForeground(new java.awt.Color(0, 0, 153));
        deleteButtonJB.setText("Delete");
        deleteButtonJB.setFocusable(false);
        deleteButtonJB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        deleteButtonJB.setPreferredSize(new java.awt.Dimension(80, 25));
        deleteButtonJB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        deleteButtonJB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteButtonJBActionPerformed(evt);
            }
        });
        jToolBar3.add(deleteButtonJB);

        jButton1.setForeground(new java.awt.Color(0, 0, 153));
        jButton1.setText("Owner Info");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar3.add(jButton1);

        javax.swing.GroupLayout ownerPanelLayout = new javax.swing.GroupLayout(ownerPanel);
        ownerPanel.setLayout(ownerPanelLayout);
        ownerPanelLayout.setHorizontalGroup(
            ownerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        ownerPanelLayout.setVerticalGroup(
            ownerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 361, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar3, javax.swing.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(ownerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar3, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ownerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void addButtonJBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonJBActionPerformed
        ownerPanel.setVisible(false);
        ownerPanel.removeAll();
        ownerAdd.setVisible(true);
        ownerPanel.add(ownerAdd);
        ownerPanel.setVisible(true);
        ownerAdd.clean();
    }//GEN-LAST:event_addButtonJBActionPerformed

    private void updateButtonJBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonJBActionPerformed

        ownerPanel.setVisible(false);
        ownerPanel.removeAll();
        ownerUpdateFrame.setVisible(true);
        ownerPanel.add(ownerUpdateFrame);
        ownerPanel.setVisible(true);
    }//GEN-LAST:event_updateButtonJBActionPerformed

    private void deleteButtonJBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonJBActionPerformed
        ownerDelete.setVisible(true);
    }//GEN-LAST:event_deleteButtonJBActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        ownerPanel.setVisible(false);
        ownerPanel.removeAll();
        ownerReadFrame.setVisible(true);
        ownerPanel.add(ownerReadFrame);
        ownerPanel.setVisible(true);
        ownerReadFrame.initInfoOwner();
    }//GEN-LAST:event_jButton1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addButtonJB;
    private javax.swing.JButton deleteButtonJB;
    private javax.swing.JButton jButton1;
    private javax.swing.JToolBar jToolBar3;
    private javax.swing.JPanel ownerPanel;
    private javax.swing.JButton updateButtonJB;
    // End of variables declaration//GEN-END:variables
}
